import {Navigate,useRoutes} from "react-router-dom"
// import Login from "../pages/login/login" 
// import Home from "../pages/home/home"
import lazyLoad from "@/hooks/lazyLoad"
import React from "react"

export const rooterRouter=[
    {
        path:'/',
        element:<Navigate to="/login"></Navigate>
    },
    {
        path:"/login",
        element:lazyLoad(React.lazy(()=>import('@/pages/login/login'))),
        meta:{
            requireAuth:false,
            title:"首页",
            key:"login"
        }
    },
    {
        path:'/home',
        element:lazyLoad(React.lazy(()=>import('@/pages/home/home')))
    }
]

const Router=()=>{
   return useRoutes(rooterRouter)
}
export default Router